package com.procurement.material.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.api.domain.PcmSupplier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.procurement.material.mapper.PcmMaterialSupplierMapper;
import com.procurement.material.domain.PcmMaterialSupplier;
import com.procurement.material.service.IPcmMaterialSupplierService;

/**
 * 物料供应商Service业务层处理
 * 
 * @author liyang
 * @date 2023-11-28
 */
@Service
public class PcmMaterialSupplierServiceImpl implements IPcmMaterialSupplierService 
{
    @Autowired
    private PcmMaterialSupplierMapper pcmMaterialSupplierMapper;



    /**
     * 查询供应商
     */
    @Override
    public  List<PcmSupplier>  supplierList(){
        return pcmMaterialSupplierMapper.supplierList();
    };

    /**
     * 查询物料供应商
     * 
     * @param materialQualificationID 物料供应商主键
     * @return 物料供应商
     */
    @Override
    public PcmMaterialSupplier selectPcmMaterialSupplierByMaterialQualificationID(Long materialQualificationID)
    {
        return pcmMaterialSupplierMapper.selectPcmMaterialSupplierByMaterialQualificationID(materialQualificationID);
    }

    /**
     * 查询物料供应商列表
     * 
     * @param pcmMaterialSupplier 物料供应商
     * @return 物料供应商
     */
    @Override
    public List<PcmMaterialSupplier> selectPcmMaterialSupplierList(PcmMaterialSupplier pcmMaterialSupplier)
    {
        return pcmMaterialSupplierMapper.selectPcmMaterialSupplierList(pcmMaterialSupplier);
    }

    /**
     * 新增物料供应商
     * 
     * @param pcmMaterialSupplier 物料供应商
     * @return 结果
     */
    @Override
    public int insertPcmMaterialSupplier(PcmMaterialSupplier pcmMaterialSupplier)
    {
        return pcmMaterialSupplierMapper.insertPcmMaterialSupplier(pcmMaterialSupplier);
    }

    /**
     * 修改物料供应商
     * 
     * @param pcmMaterialSupplier 物料供应商
     * @return 结果
     */
    @Override
    public int updatePcmMaterialSupplier(PcmMaterialSupplier pcmMaterialSupplier)
    {
        pcmMaterialSupplier.setUpdateTime(DateUtils.getNowDate());
        return pcmMaterialSupplierMapper.updatePcmMaterialSupplier(pcmMaterialSupplier);
    }

    /**
     * 批量删除物料供应商
     * 
     * @param materialQualificationIDs 需要删除的物料供应商主键
     * @return 结果
     */
    @Override
    public int deletePcmMaterialSupplierByMaterialQualificationIDs(Long[] materialQualificationIDs)
    {
        return pcmMaterialSupplierMapper.deletePcmMaterialSupplierByMaterialQualificationIDs(materialQualificationIDs);
    }

    /**
     * 删除物料供应商信息
     * 
     * @param materialQualificationID 物料供应商主键
     * @return 结果
     */
    @Override
    public int deletePcmMaterialSupplierByMaterialQualificationID(Long materialQualificationID)
    {
        return pcmMaterialSupplierMapper.deletePcmMaterialSupplierByMaterialQualificationID(materialQualificationID);
    }
}
